#!/usr/bin/env bash

set -e -u -x
source ./tasks/helpers.sh

hugo_version="0.129.0"
hugo_hash="14a4919808a10c876a2725dd0a119f979982c1636b099868fdbd358578093521"
if [ "$TARGETARCH" == "arm64" ]; then
  hugo_hash="628e8c5dad51ee9b2cf114af2c3d31ef7d8c7d6e9ff3ef38e40849f1a9d489c2"
fi

task_working_dir
download "https://github.com/gohugoio/hugo/releases/download/v${hugo_version}/hugo_extended_${hugo_version}_linux-${TARGETARCH}.tar.gz" "sha256" "$hugo_hash"
extract_download "hugo_extended_${hugo_version}_linux-${TARGETARCH}.tar.gz"

install -D -m 755 "hugo" "$DEV_INSTALL_PREFIX/bin/hugo"

stamp
